package cz.muni.fi.pa165.travelagency.persistence;

import cz.muni.fi.pa165.travelagency.entities.Tour;

/**
 * Interface for tour data access objects
 * @author Petr Stribny
 * @created 16-10-2012
 * @version 1.0
 */
public interface ITourDAO {

    /**
     * Creates tour in repository
     * @param tour
     * @throws IllegalArgumentException if tour is null
     * @throws IllegalStateException if tour.id is not null
     * @throws IllegalArgumentException if tour.name is null or empty
     * @throws IllegalArgumentException if tour.capacity is less or equals zero
     * @throws IllegalArgumentException if tour.pricePerPerson is less or equals zero
     */
    public void createTour(Tour tour);

    /**
     * Deletes tour from repository
     * @param tour
     * @throws IllegalArgumentException if tour is null
     * @throws IllegalStateException if tour.id is null
     */
    public void deleteTour(Tour tour);

    /**
     * Retrieves a tour from repository
     * @param id
     * @throws IllegalArgumentException if id is null
     * @return tour with specified id
     */
    public Tour getTour(Long id);

    /**
     * Updates tour
     * @param tour
     * @throws IllegalArgumentException if tour is null
     * @throws IllegalStateException if tour.id is null
     * @throws IllegalArgumentException if tour.name is null or empty
     * @throws IllegalArgumentException if tour.capacity is less or equals zero
     * @throws IllegalArgumentException if tour.pricePerPerson is less or equals zero
     */
    public void updateTour(Tour tour);
}